﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeBuilder
{
    public class Helper
    {
        public static string GetPascalCase(string name)
        {
            if (string.IsNullOrEmpty(name)) return name;
            var pascalCase = "";
            var nameArray = name.Split('_');
            for (int i = 0; i < nameArray.Length; i++)
            {
                pascalCase += nameArray[i][0].ToString().ToUpper() + nameArray[i].Substring(1); 
            }
            return pascalCase;
        }

        public static string GetCamelCase(string name)
        {
            if (string.IsNullOrEmpty(name)) return name;
            var camelCase = "";
            var nameArray = name.Split('_');
            camelCase = nameArray[0][0].ToString().ToLower() + nameArray[0].Substring(1);
            for (int i = 1; i < nameArray.Length; i++)
            {
                camelCase += nameArray[i][0].ToString().ToUpper() + nameArray[i].Substring(1);
            }
            return camelCase;
        }
    }
}
